#coding:utf-8  


class Pipe(object):
    __slots__= ("__call__","__ror__","function")
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        return self.function(other)

    def __call__(self, *args, **kwargs):
        return Pipe(lambda x: self.function(x, *args, **kwargs))
        
        
@Pipe
def extractUserInfo(xml):
        res = filter(lambda node : node.name == "User",xml.firstChildElement().children)
        return res and res[0].attributes or {}
        
        
def enum(*sequential, **named):
    enums = dict(zip(sequential, range(len(sequential))), **named)
    return type('Enum', (), enums)
    
def join(*args):
        return "".join(args)